<script>
	export default {
		// 1.0.78
		onLaunch: function(options) {
		
			// #ifdef MP-WEIXIN
			console.log('App Launch')
			console.log('===', options.query.pid)
			const info = wx.getSystemInfoSync()
			let handy = 1
			if (info.system.indexOf('Android') > -1) {
				handy = 1
			} else {
				handy = 2
			}
			let pid = 0
			if (options.query && options.query.pid) {
				pid = parseInt(options.query.pid)
			}
			uni.login({
				provider: 'weixin',
				success: (res) => {
					this.$req.post('/shanghu/userlogin', {
						code: res.code,
						handy: handy,
						pid: pid
					}).then(res => {
						uni.setStorageSync('uid', res.data.data.id)
						uni.setStorageSync('userInfo', res.data.data)
					})
				},
				fail: (err) => {
					console.log('登录失败', err)
				}
			})
			// #endif
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	@import "@/uni_modules/uview-ui/index.scss";

	view {
		box-sizing: border-box;
	}

	.rowbox {
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		box-sizing: border-box;
	}

	.columnbox {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		box-sizing: border-box;
	}

	.wdh-100 {
		width: 100%;
	}

	.spb {
		justify-content: space-between;
	}

	.jus {
		justify-content: flex-start;
	}

	.als {
		align-items: flex-start;
	}

	.def-col {
		color: #57bd6a;
	}

	.def-bgcol {
		background: #57bd6a;
	}

	.textovflow {
		text-overflow: ellipsis;
		white-space: nowrap;
		overflow: hidden;
	}

	.grey-btn {
		background: #c9ceca;
	}
</style>